﻿<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/ui-res.css">
    <link rel="stylesheet" href="css/ui-box.css?v=202021">
    <link rel="stylesheet" href="css/ui-base.css?v=202021"> 
    <link rel="stylesheet" href="css/ui-position.css?v=202021">
    <link rel="stylesheet" href="css/ui-img.css?v=202021">
    <link rel="stylesheet" href="css/ui-color.css?v=202021">
    <link rel="stylesheet" href="css/ui-input.css?v=202021">
    <link rel="stylesheet" href="css/iBox.css?v=202021">
    <link rel="stylesheet" href="css/ensureNode.css?v=202021">
    
    <script src="js/zy_control.js"></script>
    <script src="js/zy_click.js"></script> 
    <script src="js/zy_json.js"></script>
    <script src="js/appcan.min.js"></script>
    <script src="js/iBox.js?v=202022"></script>
    <script src="js/main.js"></script>
    <script src="js/common.js"></script>
<style type="text/css">
        .bd_b3{
            border-bottom: 1px solid gray;
        }
        .fs10{
            font-family: "Microsoft YaHei";
            font-size: 1em;
        }
        .fs07{
            font-family: "Microsoft YaHei";
            font-size: .7em;
            
        }
        .you1{
            background:url(image/you1.png)no-repeat 0 0;background-size:.8em;background-position:center;
        }
        .xia1{
            background:url(image/xia1.png)no-repeat 0 0;background-size:.8em;background-position:center;
        }
        .recordBtnDisabled {
            width: 90%;
            height: 1.62em;
            background-color: #B8B8B8;
            text-align: center;
            vertical-align: middle;
            font-family: "Microsoft YaHei";
            font-size: .8em;
            color: white;
            margin: 0 auto;
            -moz-border-radius: .3em;
            -webkit-border-radius: .3em;
            line-height: 1.62em;
            }
    </style>
</head>
<body class="um-vp es-bg" ontouchstart>
  <div class="ub ub-ver">
    <!--块容器开始-->
    <div class="nodeTop" id="nTop">
        <div class="dv1">
            <div>机号</div>
            <div class="dp"  id="jh">-</div>
        </div>
        <div class="dv1">
            <div>机型</div>
            <div class="dp" id="jx">-</div>
        </div>
        <div class="dv1">
            <div>机位</div>
            <div class="dp" id="jw">-</div>
        </div>
        <div class="dv2">
            <div>进港旅客人数</div>
            <div class="dp">-</div>
        </div>
    
    </div>
    
    <div class="nodeMid" id="nMid">
        <table class="nodeMidTable" width="100%">
            <tr>
              <td>节点名称</td>
              <td>开始时间</td>
              <td>结束时间</td>
            </tr>   
        </table>
    </div>
    
    <div class="nodeBody es-bg " id="createtable" style="overflow:auto;width: 99%;">
    </div>  
</div> 
    <div id="show" style="display:none;position: absolute;top:10em;width:100%">  
        <div style="border: 1px solid white; width: 70%; background-color: rgb(45, 45, 45); border-top-left-radius: 0.6em; border-top-right-radius: 0.6em; border-bottom-right-radius: 0.6em; border-bottom-left-radius: 0.6em; box-shadow: rgba(0, 0, 0, 0.498039) 0px 5px 8px;margin:0 auto;">
            <div class="ub ub-ac ub-pc" style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: gray;">
                <h1 style="padding:0.5em 0 .5em; font-size:1.5em">修改备注</h1>
            </div>
                <div style="padding: 0.5em; font-size: 1.1em;"> 
                    <textarea id="area" name="" rows="3" cols="25" style="margin: 0 auto;font-size: 1em" autofocus=""></textarea>
                </div>
                <div class="ub-fh ub ub-ac ub-pc c-m2" style="margin-top: 1em; background-color: rgb(32, 32, 32); padding: 0.5em 0px; border-bottom-left-radius: 0.6em; border-bottom-right-radius: 0.6em;">
                <button id="btn_0" style="padding: 0.5em 1em; font-size: 1.2em;" onclick="queren()">确定</button><button id="btn_1" style="padding: 0.5em 1em; font-size: 1.2em;" onclick="quxiao()">取消</button>
                </div>
        </div>
    </div>
</body>
<script>
zy_init();
var rPath="http://hccess.ceair.com/HubManagerWebService/HubManagerWebService.asmx";
//时区处理
window.localStorage.setItem("myTimezone","8");
 function calcTime(ggtime){
     var ystime=ggtime;
     if(ggtime==null) return "";
     console.log("beforedata:"+ggtime);
     var offset=window.localStorage.getItem("myTimezone_df");
     if(ggtime==""){
     }else{ 
         if(ggtime.split(' ')[2]=="PM"){ 
             var hms=trasTime(ggtime.split(' ')[1]);
             ggtime=ggtime.split(' ')[0].split("/")[2]+"/"+ggtime.split(' ')[0].split("/")[0]+"/"+ggtime.split(' ')[0].split("/")[1]+" "+hms;
              var d = new Date(ggtime); 
             var utc = d.getTime() + (d.getTimezoneOffset() * 60000);  
             var nd = new Date(utc + (3600000*offset));
             ggtime=(nd+"").split(" ")[3]+"-"+(nd+"").split(" ")[2]+"-"+(nd+"").split(" ")[0]+" "+(nd+"").split(" ")[4];
             console.log("gh:"+ggtime);
             return (nd+"").split(" ")[4];
         }else if(ggtime.split(' ')[2]=="AM"){
             ggtime=ggtime.split(' ')[0].split("/")[2]+"/"+ggtime.split(' ')[0].split("/")[0]+"/"+ggtime.split(' ')[0].split("/")[1]+" "+ggtime.split(' ')[1]
              var d = new Date(ggtime); 
             var utc = d.getTime() + (d.getTimezoneOffset() * 60000);  
             var nd = new Date(utc + (3600000*offset));
             ggtime=(nd+"").split(" ")[3]+"/"+(nd+"").split(" ")[2]+"/"+(nd+"").split(" ")[0]+" "+(nd+"").split(" ")[4];
             console.log("gh:"+ggtime);
             return (nd+"").split(" ")[4];
         }else{ 
             ggtime=ggtime.split(' ')[0].split("-")[0]+"/"+ggtime.split(' ')[0].split("-")[1]+"/"+ggtime.split(' ')[0].split("-")[2]+" "+ggtime.split(' ')[1];
             var d = new Date(ggtime); 
             var utc = d.getTime() + (d.getTimezoneOffset() * 60000);  
             var nd = new Date(utc + (3600000*offset));
             ggtime=(nd+"").split(" ")[3]+"-"+(nd+"").split(" ")[2]+"-"+(nd+"").split(" ")[0]+" "+(nd+"").split(" ")[4];
             console.log("gh:"+ggtime);
             if((nd+"").split(" ")[4]==undefined){
                 if(ystime.split(" ")[1]==undefined){
                     return ystime;
                 }else{
                     return ystime.split(" ")[1];
                 }
             }else{
                 return (nd+"").split(" ")[4];
             }
         }
     } 
} 

var key='';
var Hg;//列表高度
window.uexOnload=function(type){
        if(!type){
            key=getLocVal("Key");
            var nodeTop=$$("nTop").offsetHeight;
            var nodeMid=$$("nMid").offsetHeight;
            var bodyH = document.body.clientHeight;
            Hg=bodyH-nodeTop-nodeMid-50;
            getTasks();
            //alert(calcTime("8/13/2016 4:36:33 AM"))
             uexWindow.toast('0', '5', '正在加载请稍后....', 0);
        }
    }
    function getTasks()
    {   
        var fttype=window.localStorage.getItem("fttype");
        fttype="out";
        var url=yddfProUrl+"system_getHbrw.action"; 
        console.log(key);  
        //key="89659998@info$MU2403#2016-11-29 05:40:00";
        var idata =[{'key':'key','type':'0','value':key},{'key':'type','type':'0','value':fttype}];
       console.log(JSON.stringify(idata));
        $.getJSON(url, function(json){ 
             uexWindow.closeToast();
           console.log(JSON.stringify(json));
                GetData(json);
        }, "json",function(err){
            alert(err);
                }, "POST",idata,false);
    }
   function reNull(da){ 
        if(da==null|da=="null"|da==undefined){
            return ""
        }else{
            return da;
        }
   }
  function GetData(data)
  {
                    var strx='';
                    strx+='<table style="word-break:break-all; word-wrap:break-word;background-color:rgba(255,255,255,.4)">';
                    var jh =data.jh==''?'-': data.jh;
                    var jx =data.jx==''?'-': data.jx;
                    var jw=data.jw==''?'-':data.jw;
                    $$("jh").innerHTML=jh;
                    $$("jx").innerHTML=jx;
                    $$("jw").innerHTML=jw;
                    var tempJson=data.rw;
                    len=tempJson.length;
                    var htmlbb="";
                    console.log(tempJson);
                     for(var i=0;i<len;i++)
                    {
                        
                        var TASKID = tempJson[i].TASKID;
                        var TASKTYPE = tempJson[i].TASKTYPE;
                        var TASKNAME = tempJson[i].TASKNAME;
                        TASKNAME=getTaskNameCHN(TASKNAME);
                        var SCHEDULEDSTARTTIME =tempJson[i].SCHEDULEDSTARTTIME;   //格式：10/22/2015 9:39:00 AM
                        var SCHEDULEDENDTIME = tempJson[i].SCHEDULEDENDTIME;
                        var ACTUALSTARTTIME = tempJson[i].ACTUALSTARTTIME;
                        var lb_ACTUALSTARTTIME=tempJson[i].ACTUALSTARTTIME;
                        var lb_ACTUALENDTIME=tempJson[i].ACTUALENDTIME;
                        lb_ACTUALSTARTTIME=calcTime(lb_ACTUALSTARTTIME);
                        lb_ACTUALENDTIME=calcTime(lb_ACTUALENDTIME);
                        var lb_ACTUALTIME=tempJson[i].ACTUALTIME;
                        lb_ACTUALTIME=calcTime(lb_ACTUALTIME);
                        
                        if(ACTUALSTARTTIME.length>0)
                        {
                            if(ACTUALSTARTTIME.split(' ')[2]=='PM')
                            {
                                ACTUALSTARTTIME=trasTime(ACTUALSTARTTIME.split(' ')[1]);
                            }
                            else{
                                    ACTUALSTARTTIME=ACTUALSTARTTIME.split(' ')[1];
                            }
                            
                        }
                    
                        var ACTUALENDTIME = tempJson[i].ACTUALENDTIME;
                        console.log("ACTUALENDTIME"+ACTUALENDTIME);
                        if(ACTUALENDTIME.length>0)
                        {
                            if(ACTUALENDTIME.split(' ')[2]=='PM')
                            {
                                ACTUALENDTIME=trasTime(ACTUALENDTIME.split(' ')[1]);
                            }
                            else{
                                    ACTUALENDTIME=ACTUALENDTIME.split(' ')[1];
                            }
                        }
                        
                        var SCHEDULEDTIME = tempJson[i].SCHEDULEDTIME;
                        var ACTUALTIME =tempJson[i].ACTUALTIME;
                        if(ACTUALTIME.length>0)
                        {
                            if(ACTUALTIME.split(' ')[2]=='PM')
                            {
                                ACTUALTIME=trasTime(ACTUALTIME.split(' ')[1]);
                            }
                            else{
                                    ACTUALTIME=ACTUALTIME.split(' ')[1];
                            }
                        }
                        var TASKSTATUS = tempJson[i].TASKSTATUS;
                        var ISSYSTEM = tempJson[i].ISSYSTEM;
                        
                        var TASKRECEIVETIME = tempJson[i].TASKRECEIVETIME;
                        var TASKREADYTIME = tempJson[i].TASKREADYTIME;
                        var Time=tempJson[i].sj;   //格式：2015-10-22 09:37:00
                        Time=Time.split(" ")[0];
                        
                         var BtnStart='<div id="STARTTIME_'+TASKID+'" class="recordBtn" onclick="recordClick(\'STARTTIME_'+TASKID+'\',\'' +TASKTYPE+ '\',\'' +ACTUALSTARTTIME+ '\',\'' +ACTUALENDTIME+ '\',\'' +TASKRECEIVETIME+ '\',\'' +TASKREADYTIME+ '\',\'' +ACTUALTIME+ '\',\'' +Time+ '\')">记 录</div>';
    
var BtnEnd='<div id="ENDTIME_'+TASKID+'" class="recordBtnDisabled">记 录</div>';
var BtnEnd2='<div id="ENDTIME_'+TASKID+'" class="recordBtn" onclick="recordClick(\'ENDTIME_'+TASKID+'\',\'' +TASKTYPE+ '\',\'' +ACTUALSTARTTIME+ '\',\'' +ACTUALENDTIME+ '\',\'' +TASKRECEIVETIME+ '\',\'' +TASKREADYTIME+ '\',\'' +ACTUALTIME+ '\',\'' +Time+ '\')">记 录</div>';    
                        
                         var isAuto=false;
                         if(ISSYSTEM=="1")
                         {
                            isAuto=true;
                         }
                          var str0='';
                            var str1='';
                              var str2='';
                             if(TASKTYPE=='ACTIVITY')
                            {
                                if(isAuto)
                                {    
                                     str0+='<div class="time autoColor clickenable uc-tbr uc-tbl" onclick="taskNameClick(\''+SCHEDULEDSTARTTIME+'\',\'' +SCHEDULEDENDTIME+ '\')">'+TASKNAME+'</div>';
                                }else{
                                     str0+='<div class="time clickenable uc-tbr uc-tbl" onclick="taskNameClick(\''+SCHEDULEDSTARTTIME+'\',\'' +SCHEDULEDENDTIME+ '\')">'+TASKNAME+'</div>';
                                }
                            }else
                            {
                                if(isAuto)
                                {
                                     str0+='<div class="time autoColor">'+TASKNAME+'</div>';
                                }else{
                                     str0+='<div class="time">'+TASKNAME+'</div>';
                                }
                            }
                            
                            /////
                            if(isAuto)     //自动
                                    {
                                        if(TASKTYPE=='ACTIVITY')
                                        {
                                            if(ACTUALSTARTTIME!='') 
                                            {
                                                str1+='<div class="time">'+lb_ACTUALSTARTTIME+'</div>';
                                            }else{
                                                str1+='<div class="time">'+'-'+'</div>';
                                            }
                                        }else{
                                             str1+='<div class="time">'+''+'</div>';
                                        }
                                    }
                                    else{     //手动
                                        if(TASKTYPE=='ACTIVITY')
                                        {
                                            if(ACTUALSTARTTIME!='')
                                            {
                                                str1+='<div class="time">'+lb_ACTUALSTARTTIME+'</div>';
                                            }else{
                                                str1+=BtnStart;
                                            }
                                        }else{
                                             str1+='<div class="time">'+''+'</div>';
                                        }
                                    }
                        /////////////
                        if(isAuto)     //自动
                        {
                            if(TASKTYPE=='ACTIVITY')
                            {
                                if(ACTUALENDTIME!='')
                                {
                                    str2+='<div class="time">'+lb_ACTUALENDTIME+'</div>';
                                }else{
                                    str2+='<div class="time">'+'-'+'</div>';
                                }
                            }else{
                                 if(ACTUALTIME!='')
                                {
                                    str2+='<div class="time">'+lb_ACTUALTIME+'</div>';
                                }else{
                                    str2+='<div class="time">'+'-'+'</div>';
                                }
                            }
                        }
                        else{     //手动
                            if(TASKTYPE=='ACTIVITY')
                            {
                                if(ACTUALENDTIME!='')
                                {
                                    str2+='<div class="time">'+lb_ACTUALENDTIME+'</div>';
                                }else{
                                    if(ACTUALSTARTTIME!='')
                                    {
                                        str2+=BtnEnd2;
                                    }else{
                                        str2+=BtnEnd;
                                    }
                                }
                            }else{
                                 if(ACTUALTIME!='')
                                {
                                    str2+='<div class="time">'+lb_ACTUALTIME+'</div>';
                                }else{
                                    str2+=BtnEnd2;
                                }
                            }
                        }
                        ////////
                         // htmlbb+='<div style="width: 99%;display: -webkit-box;border: 1px solid gray;text-align: center;line-height: 1.62em;background: rgba(255,255,255,.3)" >'
                             // +'<div style="width:33.3%;border-right: 1px solid gray;line-height:1.62em" >'+str0+'</div>'
                             // +'<div class="ub ub-ac ub-pc" style="width: 33.3%;border-right: 1px solid gray" >'+str1+'</div>'
                             // +'<div class="ub ub-ac ub-pc" style="width: 33.3%" >'+str2+'</div>'
                             // +'</div>'
                        var borders;
                        if(i<len){
                            borders='bd_b3'
                        }else{
                             borders=''
                        } 
                        var beizhus="备注";
                        var TASKTYPE=reNull(tempJson[i].TASKTYPE);
                        var vls=tempJson[i].taskRemark;
                        var aa1=tempJson[i].TASKID;
                         htmlbb+='<div class="'+borders+'" style="background: rgba(255,255,255,.3);width: 100%;">'
                             +'<div style="width: 99%;display: -webkit-box;text-align: center;line-height: 1.62em;background: rgba(255,255,255,.3);padding:.5em 0" >'
                             +'<div style="width:33.3%;line-height:1.62em" >'+str0+'</div>'
                             +'<div class="ub ub-ac ub-pc" style="width: 30%;" >'+str1+'</div>'
                             +'<div class="ub ub-ac ub-pc" style="width: 30%" >'+str2+'</div>'
                             +'<div id="xia_'+i+'" class="you1" style="width:6.6%;" onclick="xiala(\'xia_' +i+ '\',\'xs_' +i+ '\')"></div>'
                             +'</div>' 
                             +'<div id="xs_'+i+'" style="display:none"><div class="ub" style="padding:.5em 0;"><div id="" style="padding-left:1em;">'+beizhus+'：</div><div id="" style="width:70%">';
                             htmlbb+='<textarea name="" TASKTYPE='+TASKTYPE+' id="area_'+i+'" value="'+vls+'" class="fs10" style="width:100%;background: rgba(255,255,255,.3);border:none" onclick="xiugai(\'area_' +i+ '\',\''+aa1+'\')">'+vls+'</textarea>'
                             htmlbb+='</div></div>' 
                             htmlbb+='<div class="uhide ub-pc"style="margin-bottom:1em"><div class="uc-tbl uc-tbr clickenable tx-c" style="padding:.2em;width:4em" onclick="queren(this)">确定</div><div class="uc-tbl uc-tbr clickenable tx-c" style="padding:.2em;width:4em;margin-left:1em" onclick="quxiao(this)">取消</div></div>'
                             +'</div></div></div>'  
                    }
                     document.getElementById("createtable").innerHTML=htmlbb;
  }
 
 function taskNameClick(starttime,endtime)
 {
    //starttime=timeHandler(starttime);
    //endtime=timeHandler(endtime);
    starttime=calcTime(starttime);
    endtime=calcTime(endtime);
    if(starttime!=null&&endtime!=null)
    {
        var str="计划开始时间："+starttime+" \n计划结束时间："+endtime;
        uexWindow.alert('提示信息',str,'确定');
    }
 }
 
function timeHandler(timeStr)
{
    if(timeStr.length>0)
    {
        if(timeStr.split(' ')[2]=='PM')
        {
            timeStr=trasTime(timeStr.split(' ')[1]);
        }
        else{
                timeStr=timeStr.split(' ')[1];
        }
        return timeStr;
    }else
    {
        return null;
    }
    
}
 function recordClick(id,TASKTYPE,ACTUALSTARTTIME,ACTUALENDTIME,TASKRECEIVETIME,TASKREADYTIME,ACTUALTIME,Time){
            var win =  appcan.require('window'); 
            win.confirm({
                title:'提示',
                content:'确定记录任务吗？',
                buttons:['确定','取消'],
                callback:function(err,data,dataType,optId){
                   if(data==0) 
                   {
                        getServiceTime(id,TASKTYPE,ACTUALSTARTTIME,ACTUALENDTIME,TASKRECEIVETIME,TASKREADYTIME,ACTUALTIME,Time);
                   }
                }
            });
            
}
/**
 * 获取服务器时间
 */
function getServiceTime(rid,TASKTYPE,ACTUALSTARTTIME,ACTUALENDTIME,TASKRECEIVETIME,TASKREADYTIME,ACTUALTIME,Time)
{
    var arr=rid.split("_");
    var id=arr[1];
    var btntype=arr[0];    //是开始or结束按钮

    var url =yddfProUrl+"hbrw_getServiceTime.action";
      uexWindow.toast('0', '5', '记录中....', 0);
    $.getJSON(url, function(xml){
//      console.log(xml)
                 uexWindow.closeToast();
                    var servicetime=xml;
                    var changedTime=xml.split('">')[1].substr(0,19);  //记录的时间包括日期
                    var lb_changedTime=calcTime(changedTime);
                    var str='<div class="time">'+lb_changedTime+'</div>';
                    //var str='<div class="time">'+xml.split('-')[3].split(' ')[1]+'</div>';
                    
                    $$(rid).parentNode.innerHTML = str;
                     console.log("changedTime"+changedTime)
                    var rctime=changedTime.split(' ')[1]; //记录的时间只含时间
                    if(btntype=='STARTTIME'&&TASKTYPE=="ACTIVITY")
                    {
                        var endId="ENDTIME_"+id;
                    $$(endId).className='recordBtn';
                    $$(endId).id=endId;
                    $$(endId).onclick = function(){
                                    recordClick(this.id,TASKTYPE,ACTUALSTARTTIME,ACTUALENDTIME,TASKRECEIVETIME,TASKREADYTIME,ACTUALTIME,Time);
                    }
//                        recordTime(id,rctime,ACTUALENDTIME);
                    }
                    else{
//                        recordTime(id,ACTUALSTARTTIME,rctime);
                    }                       
                    UpdateTaskTime(id,TASKTYPE,changedTime,btntype);  
                    
    }, "xml",function(err){
        alert(err);
            }, "POST", "");
}

/**
 * 记录更新时间  目前能提供修改的字段中若TaskType =ACTIVITY有四个字段名称actualstarttime，actualendtime，taskreceivetime，taskreadytime,TaskType =EVENT有一个字段名称actualtime
 */
function UpdateTaskTime(id,TASKTYPE,changedTime,btntype)
{
    
    var url=yddfProUrl+"hbrw_deal.action?";
    var para="";
    if(TASKTYPE=="ACTIVITY")
    {
        if(btntype=='STARTTIME')
        {
            para="actualstarttime|"+changedTime;
        }else
        {
            para="actualendtime|"+changedTime;
        }
    }else
    {
        para="actualtime|"+changedTime;
    }
    console.log("key:"+key+"--id"+id+"--TASKTYPE"+TASKTYPE+"--para"+para)
var idata =[{'key':'key','type':'0','value':key}, {'key':'Taskid','type':'0','value':id}, {'key':'TaskType','type':'0','value':TASKTYPE}, {'key':'paras','type':'0','value':para},{'key':'userid','type':'0','value':'55'}, {'key':'username','type':'0','value':'chenxinwei'}];
    $.getJSON(url, function(xml){
        console.log("XML............."+xml);
//          alert("传参："+para+"/传参地址url: "+url+"/返回值："+xml);
    }, "xml",function(err){
        alert(err);
            }, "POST",idata,false);
}
/**
 * 时间格式为：10/22/2015 9:51:00 AM
 * @param {Object} timeStr
 */
function timeHandle(time,timeStr){
    var tstr=timeStr.replace(/^\'|\'$/g,"");
    var time=time.replace(/^\'|\'$/g,"");
    if(timeStr.length>10&&timeStr!=''&&timeStr!="")
    {
        var arr=tstr.split(" ");
        return time+" "+arr[1];
    }
    return time+" ";
}
/**
 * 判断任务是否不能人工，只能自动生成true 为自动，不能手动记录
 * @param {Object} taskname
 */
function isAutoByTaskName(tasknameCHN)
{
     switch (tasknameCHN)
        {
            case "落地":
            case "滑入":
            case "上轮档":
            case "开货舱门":
            case "推出":
            case "起飞":
            case "关客舱门":
            case "关货舱门":
            case "开舱门":
            case "撤轮档":
                return true;
            break;  
            case "污水":
            case "清水":
            case "加油":
            case "撤桥梯":
            case "下客":
            case "货运卸":
            case "平衡单上传":
            case "机组到位":
            case "配餐":
            case "首件行李":
            case "值机关闭":
            case "货物到位":
            case "通知登机":
            case "分拣交接":
            case "末件行李":
            case "装机":
            case "登机":
            case "滑出":
                return false;
            break;
            default: return false;break;
        }
}
/**
 * 时间由服务器返回的12制转24制
 * @param {Object} time
 */
function trasTime(time)
{
    var arr=time.split(':')
    var h=parseInt(arr[0])+12;
    var m=arr[1];
    var s=arr[2];
    return h+":"+m+":"+s;
}
/**
 * 时间本地记录:页面重新加载记录的值被重置回未记录状态，先本地存储
 *  * @param {Object} time1:开始时间，time2:结束时间
 */
var jsonstr="{\"array\":[";
function recordTime(TASKID,time1,time2)
{
    var recObj=strToJson(localStorage.getItem("recordTime"));
    if(recObj!=null&&recObj!=undefined&&recObj!='undefined')
    {
//        jsonstr="{\"array\":[";
        for(var i=0;i<recObj.array.length;i++)
        {
            var obj=recObj.array[i];
            if(obj.TASKID==TASKID)
            {
                    if(time1!='')
                    {
                        obj.time1=time1;
                    }
                    if(time2!='')
                    {
                        obj.time2=time2;
                        alert(obj.time2)
                    }
            }
           
        }
        
    }
    if(recObj!=null)
    {
        jsonstr=JSON.stringify(recObj).substring(0,jsonstr.length-4);
    }
     console.log("/// "+jsonstr);
     jsonstr += "{\"TASKID\""+":\"" + TASKID  + "\",";
     jsonstr += "\"time1\""+":\"" + time1  + "\",";
     jsonstr += "\"time2\""+":\"" + time2  + "\"";
     jsonstr += "}]}";
     console.log("--"+jsonstr);
     setLocVal("recordTime",jsonstr);
}
/**
 * 获取记录过的时间值
 */
function getRecordTime(TASKID)
{
    var recObj=strToJson(getLocVal("recordTime"));
    if(recObj!=null&&recObj!=undefined&&recObj!='undefined')
    {
        for(var i=0;i<recObj.array.length;i++)
        {
            var obj=recObj.array[i];
            if(obj.TASKID==TASKID)
            {
                return  obj.time1+"|" +obj.time2;
            }
        }
    }
    return "|";
}
function strToJson(str){ 
    var json = eval('(' + str + ')'); 
    return json; 
}
/**
 * 任务名称中英文对照
 * @param {Object} taskname
 */
function getTaskNameCHN(taskname)
{
     switch (taskname)
        {
            case "arrive": return "落地";break;
            case "taxi": return "滑入";break;
            case "on_block": return "上轮档";break;
            case "lavetory_service_arrival": return "污水";break;
            case "water_service": return "清水";break;
            case "fuelling": return "加油";break;
            //case "air_bridge": return "客梯车";break;
            case "cargo_door_open": return "开货舱门";break;
            case "carbin_door_open": return "开舱门";break;
            case "deboarding": return "下客";break;
            case "unloading": return "货运卸";break;
            case "load_sheet_in_cockpit": return "平衡单上传";break;
            case "crew_on_board": return "机组到位";break;
            case "catering": return "配餐";break;
            case "first_bag": return "首件行李";break;
            case "checkin_counter_closed": return "值机关闭";break;
            case "cargo_on_site": return "货物到位";break;
            case "notice_to_boarding": return "通知登机";break;
            case "end_bag_sorting": return "分拣交接";break;
            case "last_bag": return "末件行李";break;
            case "load": return "装机";break;
            case "carbin_door_closed": return "关客舱门";break;
            case "boarding": return "登机";break;
            case "cargo_door_closed": return "关货舱门";break;
            case "offblocks": return "撤轮档";break;
            case "push_back": return "推出";break;
            case "taxi_out": return "滑出";break;
            case "depart": return "起飞";break;
            
            case "carbin_clean": return "客舱清洁";break;
            case "flight_inspection": return "航班督查";break;
            case "carbincrew_on_board": return "乘务登机";break;
            case "trailer": return "拖车到位";break;
            case "release_order": return "放行单上机";break;
            case "release_order_finished": return "放行单完成";break;
            case "load_sheet_finished": return "装机单完成";break;
            case "maintenance_release": return "机务放行";break;
            case "manifest_finished": return "舱单完成";break;
            case "bridge_ladder": return "靠桥梯";break;
            case "car_ferry": return "进港摆渡车";break;
            case "air_bridge": return "撤桥梯";break;
            case "boarding_start": return "上客开始(客舱)";break;
            case "deboarding_end": return "下客结束(客舱)";break;
            case "carbincrew_on_board": return "乘务登机(客舱)";break;
            default: return taskname;break;
        }
}
function xiala(id1,id2){
    if(document.getElementById(id1).className=='you1'){
        document.getElementById(id1).className='xia1';
        document.getElementById(id2).style.display='block';
    }else{
        document.getElementById(id1).className='you1';
        document.getElementById(id2).style.display='none';
    }
}
function xiugai(id,rid,TASKTYPE,ACTUALENDTIME){ 
    //$$("#"+id).parent().parent().next().removeClass("uhide").addClass("ub");
    document.getElementById(id).parentNode.parentNode.nextElementSibling.className="ub ub-pc" //nextSbiling
    document.getElementById('area').data_1=id;
    document.getElementById('area').data_2=rid; 
}
function queren(obj){  
    obj.parentNode.className="uhide";
    uexWindow.toast('0', '5', '提交中....', 0);
    var id=document.getElementById('area').data_1;  
    var rid=document.getElementById('area').data_2;
    var area="area";   
    //document.getElementById(id).text=document.getElementById('area').value;
     var url=yddfProUrl+"hbrw_deal.action?";
     var TaskType=document.getElementById(id).getAttribute("TASKTYPE")
     var idata=
     [{"key":"key","type":"0","value":key},
     {"key":"Taskid","type":"0","value":rid},
     {"key":"TaskType","type":"0","value":TaskType},
     {"key":"paras","type":"0","value":""},//actualtime|2016-10-18 14:54:44
     {"key":"userid","type":"0","value":"55"},  
     {"key":"username","type":"0","value":"chenxinwei"},     
     {"key":"taskRemark","type":"0","value":document.getElementById(id).value}]
     console.log(JSON.stringify(idata));  
     document.getElementById('area').value=''; 
     document.getElementById('show').style.display='none';
     $.getJSON(url, function(xml){
         //console.log("传参："+para+"/传参地址url: "+url+"/返回值："+xml);
         //var text=xml2json(xml).int["#text"];
         console.log(xml);
         uexWindow.closeToast();
         //alert(xml.int);
    }, "xml",function(err){
        alert(JSON.stringify(err))  
            }, "POST",idata,false);
}
function quxiao(obj){
   obj.parentNode.className="uhide";
}
</script>
</html>